<div id="edit-project"></div>
<div id="panel-form" class="create-project">
    <?if (!$this->editable):?>
        <h2>This event is not editable</h2>
    <?elseif ($this->msg!=""):?>
        <h2>Process succeeded</h2>
        <div class="msg"><?=$this->msg?></div>
    <?else:?>
        <h2>Upgrade your event</h2>
         <?php if (isset ( $this->error )) :?>
            <ul class="errors">
                 <?=$this->error ;?>
            </ul>
         <?php endif;?>
        <fieldset>
            <form action="<?=$this->escape ( $this->form->getAction () )?>" method="<?=$this->escape ( $this->form->getMethod () )?>" enctype="multipart/form-data">
                <?

                echo $this->form->titulo;
                echo $this->form->ciudad;
                echo $this->form->fecha_evento;
                $option="<option></option>";
                foreach($this->category as $cat){
                    $sel="";
                    if($cat['id_categoria']==$this->data['id_categoria'])
                            $sel="selected='selected'";
                    $option.="<option ".$sel." value='".$cat['id_categoria']."'>".$cat['categoria']."</option>";
                }
                echo '<div id="categoria-label"><label class="required" for="id_categoria">Category:</label></div>';
                echo '<span class="data"><select name="id_categoria" id="id_categoria">'.$option."</select></span>";
                echo $this->form->breve_descripcion;
                echo $this->form->descripcion;
                echo $this->form->video_embed;?>

                <div id="fecha-imagen">
                    <label class="required" for="imagen">Image:</label>
                </div>
                <span class="data">
                    <input type="file" name="imagen"/>
                </span>
                <?echo $this->form->fecha;
                echo $this->form->importe;?>
                <div class="reward">
                    <?
                        $i=0;
                        foreach ($this->rewards as $reward):
                                $i++;?>
                    <div id="reward-item" class="reward-item">
                        <span>Reward nº <b><?=$i?></b></span>
                        <?echo  str_replace('value=""','value="'.$reward['recompensa'].'"', str_replace("recompensa","recompensa[]", $this->form->recompensa));
                            echo str_replace('value=""','value="'.$reward['apoyo_minimo'].'"', str_replace("minimo","minimo[]", $this->form->minimo));
                            ?>
                        <div>
                            <span class="data">
                                Auctioned?
                                <input class="check_subasta" type="checkbox" <?=($reward['subasta']=="S"?"checked='checked'":"")?> value="" name="subasta_<?=$i?>">
                            </span>
                            <span class="data">
                                Ticket not included
                                <input class="check_no_entrada" type="checkbox" <?=($reward['no_entrada']=="S"?"checked='checked'":"")?> value="" name="no_entrada_<?=$i?>">
                            </span>
                        </div>
                    </div>
                    <?endforeach;?>
                </div>
                <input type="button" id="btn-reward" class="btn-red" value="More"/>
                <input type="button" id="btn-reward-delete" class="btn-red" value="Less"/>
                <?echo $this->form->submit; ?>
            </form>
        </fieldset>
    <?endif;?>
</div>